#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
#define int long long

const int N = 55;
int t;
void solve()
{
    int n , k , p;
    cin >> n >> k >> p;
    if(abs(k) > n * abs(p)) puts("-1");
    else
    {
        k = abs(k);
        p = abs(p);
        int ret = (k + p - 1) / p;
        cout << ret << endl;
    }
}
signed main()
{
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}